﻿using System.ComponentModel.DataAnnotations;

namespace P10_StudentManage.Models;

public class Grade
{
    [Key] // 标记为主键
    public int Id { get; set; }

    [Required(ErrorMessage = "学生姓名不能为空")]
    public string StudentName { get; set; }

    [Required(ErrorMessage = "科目不能为空")]
    public string Subject { get; set; }

    [Range(0, 100, ErrorMessage = "成绩必须在 0 到 100 之间")]
    public int Score { get; set; }
}